package com.zr.daoimpl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.zr.dao.ShowEIRDao;
import com.zr.model.Creceipt;
/**
 * lxg
 * @author Administrator
 *
 * @param <T>
 */
@Repository("shEIRdaim")
public class ShowEIRDaoImpl<T> extends BaseDaoImpl<T> implements ShowEIRDao<T>{

	@Override
	public List<Creceipt> findReceipt(int page,int rows) {
		String hql="from Creceipt as cre group by cre.reendp";
		
		Query query=this.getCurrentSession().createQuery(hql);
		query.setFirstResult((page-1)*rows);
		query.setMaxResults(rows);
		List<Creceipt>li=query.list();
		
		return li;
	}

	@Override
	public int getcount() {
		String hql="select count(cr.reid) from Creceipt as cr";
		Query query=this.getCurrentSession().createQuery(hql);
		int i=((Number)query.uniqueResult()).intValue();
		return i;
	}

	
}
